package com.android.pdd.baseapp.model;

import com.lg.meng.model.BaseServerResponse;

/**
 * Author: xx
 * Date: 2019/11/07
 * Description:
 */
public class HttpResponse<T> extends BaseServerResponse {
    private int code;
    private String msg;
    private boolean success;
    private T data;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public boolean isSuccess() {
        return code == 200;
    }

    @Override
    public boolean isShowErrorMsg() { //TODO
        return !isSuccess();
    }

    @Override
    public String getErrorMsg() {
        return msg;
    }
}
